home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
Soundtracker Soundsystem.adf
/
MegaTraxx
< prev
next >
Wrap
Text File
|
1988-03-09
|
10KB
|
205 lines
c
pxuyt
The Jungle Command
presents:
MegaTraxx
~~~~~~~~~
Author : The Exterminator
Updated: The Rasta Catcha
Date : 9-Feb-1988
MegaTraxx is a program that enables you to compose your own music for use in
intros and/or demos. MegaTraxx is based around the ReLine-software sound-
routine. I've figured out how this routine works and added a few amendments
like arpeggios on all four channels, portamento and modulation.
Editing is by use of the Seka-assembler. MegaTraxx can directly be in-
corporated in your source-file (watch out for double symbols !) or added
to the object-file later.
MegaTraxx is very fast. When MegaTraxx is played at its fastest pace, (the
speed-label set to less than about $50) a single pass through the routine can
be completed in about six 'raster-lines'. (640 pixel, non-interlaced,
four color display with no furter competing bus-activity.)
Composing music with MegaTraxx is very simple and not unlike 'SoundMonitor'
(or RockMonitor I-IV for that matter...Hi D-USA Team !) known from the C64.
You begin by selecting the samples for use as your instruments.
If you like, you can use your own samples . For this reason, the excellent
sample-editor AudioMaster, is also supplied on this disk.
But first take a look at line 465. Here you can define the name of your
master-piece. Please note that the length of this string must exactly be
twenty characters, or else MegaTraxx will not function properly.
MegaTraxx must be told where each sample begins in memory. You do this by
changing the number behind the 'move.l' instruction in the lines 44-58.
Up to fifteen samples can be incorporated in a single music-track.
In addition to the above, MegaTraxx must also be told the name, length,
volume etc. of each instrument.
This is done from line 468 onwards.
First you define the names of the instruments. Keep in mind that the length
of these strings must exactly be twenty-two characters ! (Of course, defining
the name of each sample may seem of little use. But I found that this can be
of use in the course of development.)
After this you must tell MegaTraxx the length of the instrument in WORDS.
Behind each entry in the 'SoundFiles'-directory the length of that
particular sample is given. This is the length of that sample in BYTES.
To obtain the length in WORDS, this number must be devided by two.
Furthermore, the volume of the instrument must be defined. This can be any
number from zero to sixty-four ($40).
When the words 'Start' and 'Repeat' are both zero, the instrument will be
restarted when it is completed. If 'Start' is set to zero and 'Repeat' is set
to one, the instrument will be played only once. It is also possible to play
just a small part of an instrument constantly. This is the case whenever
'Start' is set to a non-zero value. 'Start' now defines the offset to be
added to the starting-position of the sample in memory and 'Repeat' defines
the length of the part of the instrument to be played. For example, say you
had a sample in memory at location $50000 and you wished to play a part of
it, for instance from $50200 to $5045a. Now, set 'Start' to $0200
($50000+$200=$50200) and 'Repeat' to $025a. ($50200+$25a=$5045a)
When all the instruments are defined, you can start composing your master-
piece. Every piece of music written with MegaTraxx is built up from small
parts of music. MegaTraxx holds a table of numbers that define in what
sequence these parts must be played.
This table starts at line 536. To determine the number of entries in the
table MegaTraxx uses the first byte of the word in line 530. (Below the
'partinfo' label) Say you needed six entries in the table, so the word in
line 530 would become $0678.
Each byte in the table stands for a part to be played. So if your table
looked like this : $0100,$0202,$0301, MegaTraxx would first of all play
part 1, then part 0, twice part 2, part 3 and at the end part 1 again.
The parts start at line 549. Each part consists of four columns, (one for
every voice) of two words, so every line holds eight words of data. All parts
consist of thirty-two lines of data, thus each part is 512 ($0200) bytes
long. You can add as many parts as you like, memory permitting.
Each pair of words stands for a voice. I will now explain the format in which
the data for the voices is held in these pairs of words.
The following diagram shows the meaning of every nibble (4 bits) in the
words:
$ 1 2 3 a , $ 1 1 4 5
/ \|/ / | \|
/ Period / | Arpeggio or Portamento information.
Selects / Mod.
Arpeggio, Instrument #
Portamento
or silence
Instrument # : This nibble defines which instrument to use. Choose a number
from 0 to 15 ($0-$f). Zero means : use last instrument.
So if you had choosen instrument 2 to play a particular note,
and later on you wanted the same instrument to play again, you
could use the following : $X23a,$2XXXX
$X1ac,$0XXXX
Period : These three nibbles define the note that must be played by an
instrument. This table shows what number to use for a certain note :
Octave
A $07f $0fe $1fc
A# $078 $0f0 $1e0
B $071 $0e2 $1c5
C $0d6 $1ac $358
C# $0ca $194 $328
D $0be $17d $2fa
Note D# $0b4 $168 $2d0
E $0aa $153 $2a6
F $0a0 $140 $280
F# $097 $12e $25c
G $08f $11d $23a
G# $087 $10d $21a
Modulation : One voice can be programmed to modulate another. This means that
either the volume, period or volume AND period are no longer
static values that are set before starting to play a note, but
that these are subject to change during play. It can be seen
that this provides a way to program viberato and tremolo
effects.
When the modulation-nibble is zero, no modulation takes place,
when it's set to one, it means that only the volume must be
modulated. To modulate only the period, set it to two and to
modulate both the period and the volume, set it to three.
When a voice is programmed to modulate, it always modulates the
next voice. So voice1 modulates voice2, voice2 modulates voice3
and so on. When a voice is told to modulate another, that voice
is made silent. When voice4 is told to modulate, it is only made
silent, because there are no 'higher' voices than voice4.
How does this modulation work ? Well, say you programmed voice1
to modulate only the volume of voice2. The volume of voice2 is
no longer defined by the volume of that instrument. Instead, the
words in the sample of voice1 define the volume for voice2.
So if the sample of voice1 looked like this :
$0030,$0032,$0034 etc., the volume of voice2 would become $30,
then $32 and so on. This is used to introduce a viberato to
voice2. The period of voice1 defines the speed of this viberato
effect.
When voice1 was programmed to modulate the period of voice2, the
words in the sample of voice1 would define the period of voice2.
When a voice is programmed to modulate the volume AND the period
of the next voice, the first word in the sample defines the
volume, the second the period, the third the volume again and so
on.
Arpeggio and : Arpeggio is used for simulating accords. It does this by
Portamento rapidly changing the notes while playing an instrument.
To select arpeggios, set the first nibble of word one to zero.
When arpeggios are selected, MegaTraxx looks five times during
the play of one note, at the information contained in the last
byte of the second word. Each nibble in this byte defines
how many notes MegaTraxx must add to the the note currently
playing. In each of the five passes MegaTraxx does the
following with the information in the last byte of word two :
1 - Add the first nibble to the current note.
2 - Add the second nibble to the current note.
3 - Play the current note.
4 - Add the first nibble to the current note.
5 - Add the second nibble to the current note.
Portamento is used for 'sliding' of the instrument. When the
first nibble of word one is set to two, the instrument is
slided up. When its set to one, the instrument will slide
down. If portamento is in use, the information contained in
the last byte of the second word will be added to (or
subtracted from) the period of the note playing in each of
the five passes.
When the first nibble of word one is set to three, all audio
output from that voice will stop untill the next note is
started.
The 'Speed' label at the start of this program, defines the pace at which the
notes succeed each-other. Please note that, the higher the number, the slower
MegaTraxx becomes. Also, the slower MegaTraxx becomes, the longer it takes to
complete a pass through the routine. Some samples cannot handle high speeds,
so you will have to try this out.
As has been told before, the source-file of the MegaTraxx routine can
directly be incorporated in your demo/intro-source. To minimize the
possibility of a 'Double Symbol' error, all labels used in MegaTraxx start
with 'mt_'. So, when writing your program, do not use any labels that start
with 'mt_'.
At the start of your program, call the 'mt_init' routine, and to play the
music, call the routine 'mt_music' once every vertical blanking interrupt.
If you have any comments or queries about this program, feel free to write
or call :
Mark Langerak,
Oude Haven 26-28
4301 CK Zierikzee.
Call : (0)1110-16647 Holland.
press ESC for Main MenuDj p